var api = require("api");
var util=require("../utils/util");

// 获取分校列表
function get_org_list(params,token) {
  return new Promise((resolve,reject)=>{
    wx.request({
      url: api.data.requestUrl + api.data.getOrgList,
      header: {
        'content-type': 'application/json;charset=UTF-8',
        'x-access-token': token
      },
      method: 'GET',
      data: params,
      success: function (res) {
        resolve(res);
        util.show_success_toast(res)
      },
      fail: function () {
        reject();
        util.show_fail_toast()
      },
    })
  })
}
// 认证机构
function user_register_mech(params,token) {
  return new Promise((resolve,reject)=>{
    wx.request({
      url: api.data.requestUrl + api.data.registerMech,
      header: {
        'content-type': 'application/json;charset=UTF-8',
        'x-access-token': token
      },
      method: 'POST',
      data: params,
      success: function (res) {
        resolve(res);
        util.show_success_toast(res)
      },
      fail: function () {
        reject();
        util.show_fail_toast()
      },
    })
  })
}
// 机构审核不通过原因
function get_mech_type(params,token) {
  return new Promise((resolve,reject)=>{
    wx.request({
      url: api.data.requestUrl + api.data.getMechType,
      header: {
        'content-type': 'application/json;charset=UTF-8',
        'x-access-token': token
      },
      method: 'GET',
      data: params,
      success: function (res) {
        resolve(res);
        util.show_success_toast(res)
      },
      fail: function () {
        reject();
        util.show_fail_toast()
      },
    })
  })
}
// 获取订单数量
function get_order_count(token) {
  return new Promise((resolve,reject)=>{
    wx.request({
      url: api.data.requestUrl + api.data.getOrderCount,
      header: {
        'content-type': 'application/json;charset=UTF-8',
        'x-access-token': token
      },
      method: 'GET',
      success: function (res) {
        resolve(res);
        util.show_success_toast(res)
      },
      fail: function () {
        reject();
        util.show_fail_toast()
      },
    })
  })
}
// 获取订单列表
function get_order_list(params,token) {
  return new Promise((resolve,reject)=>{
    wx.request({
      url: api.data.requestUrl + api.data.orderList,
      header: {
        'content-type': 'application/json;charset=UTF-8',
        'x-access-token': token
      },
      method: 'GET',
      data: params,
      success: function (res) {
        resolve(res);
        util.show_success_toast(res)
      },
      fail: function () {
        reject();
        util.show_fail_toast()
      },
    })
  })
}
// 获取订单课程套餐详情
function get_meal_detail(params) {
  return new Promise((resolve,reject)=>{
    wx.request({
      url: api.data.requestUrl + api.data.getMealDetail,
      header: {
        'content-type': 'application/json;charset=UTF-8'
      },
      method: 'GET',
      data: params,
      success: function (res) {
        resolve(res);
        util.show_success_toast(res)
      },
      fail: function () {
        reject();
        util.show_fail_toast()
      },
    })
  })
}
// 获取订单排课时间
function get_less_list(params) {
  return new Promise((resolve,reject)=>{
    wx.request({
      url: api.data.requestUrl + api.data.getLessList,
      header: {
        'content-type': 'application/json;charset=UTF-8'
      },
      method: 'GET',
      data: params,
      success: function (res) {
        resolve(res);
        util.show_success_toast(res)
      },
      fail: function () {
        reject();
        util.show_fail_toast()
      },
    })
  })
}
// 取消订单
function cancel_order(params) {
  return new Promise((resolve,reject)=>{
    wx.request({
      url: api.data.requestUrl + api.data.cancelOrder,
      header: {
        'content-type': 'application/json;charset=UTF-8'
      },
      method: 'GET',
      data: params,
      success: function (res) {
        resolve(res);
        util.show_success_toast(res)
      },
      fail: function () {
        reject();
        util.show_fail_toast()
      },
    })
  })
}
// 确认排课
function confirm_table(params,token) {
  return new Promise((resolve,reject)=>{
    wx.request({
      url: api.data.requestUrl + api.data.confirmTable,
      header: {
        'content-type': 'application/json;charset=UTF-8',
        'x-access-token': token
      },
      method: 'GET',
      data: params,
      success: function (res) {
        resolve(res);
        util.show_success_toast(res)
      },
      fail: function () {
        reject();
        util.show_fail_toast()
      },
    })
  })
}
// 不同意排课
function cancel_table(params,token) {
  return new Promise((resolve,reject)=>{
    wx.request({
      url: api.data.requestUrl + api.data.cancelTable,
      header: {
        'content-type': 'application/json;charset=UTF-8',
        'x-access-token': token
      },
      method: 'GET',
      data: params,
      success: function (res) {
        resolve(res);
        util.show_success_toast(res)
      },
      fail: function () {
        reject();
        util.show_fail_toast()
      },
    })
  })
}
// 订单退款
function refund_order(params,token) {
  return new Promise((resolve,reject)=>{
    wx.request({
      url: api.data.requestUrl + api.data.refundOrder,
      header: {
        'content-type': 'application/json;charset=UTF-8',
        'x-access-token': token
      },
      method: 'GET',
      data: params,
      success: function (res) {
        resolve(res);
        util.show_success_toast(res)
      },
      fail: function () {
        reject();
        util.show_fail_toast()
      },
    })
  })
}
// 查询订单课程状态
function get_course_type(params,token) {
  return new Promise((resolve,reject)=>{
    wx.request({
      url: api.data.requestUrl + api.data.getCourseType,
      header: {
        'content-type': 'application/json;charset=UTF-8',
        'x-access-token': token
      },
      method: 'GET',
      data: params,
      success: function (res) {
        resolve(res);
        // util.show_success_toast(res)
      },
      fail: function () {
        reject();
        util.show_fail_toast()
      },
    })
  })
}
// 获取收藏总数
function call_all_count(token) {
  return new Promise((resolve,reject)=>{
    wx.request({
      url: api.data.requestUrl + api.data.callAllCount,
      header: {
        'content-type': 'application/json;charset=UTF-8',
        'x-access-token': token
      },
      method: 'GET',
      success: function (res) {
        resolve(res);
        util.show_success_toast(res)
      },
      fail: function () {
        reject();
        util.show_fail_toast()
      },
    })
  })
}
// 获取课程机构列表
function get_call_cour_list(params,token) {
  return new Promise((resolve,reject)=>{
    wx.request({
      url: api.data.requestUrl + api.data.getCallCourList,
      header: {
        'content-type': 'application/json;charset=UTF-8',
        'x-access-token': token
      },
      method: 'GET',
      data: params,
      success: function (res) {
        resolve(res);
        util.show_success_toast(res)
      },
      fail: function () {
        reject();
        util.show_fail_toast()
      },
    })
  })
}
// 获取收藏机构列表
function get_call_mech_list(params,token) {
  return new Promise((resolve,reject)=>{
    wx.request({
      url: api.data.requestUrl + api.data.getCallMechList,
      header: {
        'content-type': 'application/json;charset=UTF-8',
        'x-access-token': token
      },
      method: 'GET',
      data: params,
      success: function (res) {
        resolve(res);
        util.show_success_toast(res)
      },
      fail: function () {
        reject();
        util.show_fail_toast()
      },
    })
  })
}
// 获取收藏知识库列表
function get_call_base_list(params,token) {
  return new Promise((resolve,reject)=>{
    wx.request({
      url: api.data.requestUrl + api.data.getCallBaseList,
      header: {
        'content-type': 'application/json;charset=UTF-8',
        'x-access-token': token
      },
      method: 'GET',
      data: params,
      success: function (res) {
        resolve(res);
        util.show_success_toast(res)
      },
      fail: function () {
        reject();
        util.show_fail_toast()
      },
    })
  })
}
// 获取收藏名师列表
function get_call_teac_list(params,token) {
  return new Promise((resolve,reject)=>{
    wx.request({
      url: api.data.requestUrl + api.data.getCallTeacList,
      header: {
        'content-type': 'application/json;charset=UTF-8',
        'x-access-token': token
      },
      method: 'GET',
      data: params,
      success: function (res) {
        resolve(res);
        util.show_success_toast(res)
      },
      fail: function () {
        reject();
        util.show_fail_toast()
      },
    })
  })
}
// 获取优惠券分类
function get_pref_nav(token) {
  return new Promise((resolve,reject)=>{
    wx.request({
      url: api.data.requestUrl + api.data.getPrefNav,
      header: {
        'content-type': 'application/json;charset=UTF-8',
        'x-access-token': token
      },
      method: 'GET',
      success: function (res) {
        resolve(res);
        util.show_success_toast(res)
      },
      fail: function () {
        reject();
        util.show_fail_toast()
      },
    })
  })
}
// 获取我的优惠券列表
function get_my_pref_list(params,token) {
  return new Promise((resolve,reject)=>{
    wx.request({
      url: api.data.requestUrl + api.data.getMyprefList,
      header: {
        'content-type': 'application/json;charset=UTF-8',
        'x-access-token': token
      },
      method: 'GET',
      data: params,
      success: function (res) {
        resolve(res);
        util.show_success_toast(res)
      },
      fail: function () {
        reject();
        util.show_fail_toast()
      },
    })
  })
}
// 获取平台券列表
function get_receive_count(params,token) {
  return new Promise((resolve,reject)=>{
    wx.request({
      url: api.data.requestUrl + api.data.getReceiveCount,
      header: {
        'content-type': 'application/json;charset=UTF-8',
        'x-access-token': token
      },
      method: 'GET',
      data: params,
      success: function (res) {
        resolve(res);
        util.show_success_toast(res)
      },
      fail: function () {
        reject();
        util.show_fail_toast()
      },
    })
  })
}
// 获取每日优惠券列表
function get_every_pref_list(params,token) {
  return new Promise((resolve,reject)=>{
    wx.request({
      url: api.data.requestUrl + api.data.getEveryprefList,
      header: {
        'content-type': 'application/json;charset=UTF-8',
        'x-access-token': token
      },
      method: 'GET',
      data: params,
      success: function (res) {
        resolve(res);
        util.show_success_toast(res)
      },
      fail: function () {
        reject();
        util.show_fail_toast()
      },
    })
  })
}
// 获取未读消息总数
function get_unRead_news(token) {
  return new Promise((resolve,reject)=>{
    wx.request({
      url: api.data.requestUrl + api.data.getUnReadNews,
      header: {
        'content-type': 'application/json;charset=UTF-8',
        'x-access-token': token
      },
      method: 'GET',
      success: function (res) {
        resolve(res);
        util.show_success_toast(res)
      },
      fail: function () {
        reject();
        util.show_fail_toast()
      },
    })
  })
}
// 获取未读消息数
function get_unRead_cateNews(token) {
  return new Promise((resolve,reject)=>{
    wx.request({
      url: api.data.requestUrl + api.data.getUnReadCateNews,
      header: {
        'content-type': 'application/json;charset=UTF-8',
        'x-access-token': token
      },
      method: 'GET',
      success: function (res) {
        resolve(res);
        util.show_success_toast(res)
      },
      fail: function () {
        reject();
        util.show_fail_toast()
      },
    })
  })
}
// 获取最新的通知
function get_news_list(params,token) {
  return new Promise((resolve,reject)=>{
    wx.request({
      url: api.data.requestUrl + api.data.getNewsList,
      header: {
        'content-type': 'application/json;charset=UTF-8',
        'x-access-token': token
      },
      method: 'GET',
      data: params,
      success: function (res) {
        resolve(res);
        util.show_success_toast(res)
      },
      fail: function () {
        reject();
        util.show_fail_toast()
      },
    })
  })
}
// 消息已读
function read_news(params,token) {
  return new Promise((resolve,reject)=>{
    wx.request({
      url: api.data.requestUrl + api.data.readNews,
      header: {
        'content-type': 'application/json;charset=UTF-8',
        'x-access-token': token
      },
      method: 'GET',
      data: params,
      success: function (res) {
        resolve(res);
        util.show_success_toast(res)
      },
      fail: function () {
        reject();
        util.show_fail_toast()
      },
    })
  })
}
// 消息分页详情
function get_newsDetail_list(params,token) {
  return new Promise((resolve,reject)=>{
    wx.request({
      url: api.data.requestUrl + api.data.getNewsDetailList,
      header: {
        'content-type': 'application/json;charset=UTF-8',
        'x-access-token': token
      },
      method: 'GET',
      data: params,
      success: function (res) {
        resolve(res);
        util.show_success_toast(res)
      },
      fail: function () {
        reject();
        util.show_fail_toast()
      },
    })
  })
}
// 个人资料
function get_personal_dom(params) {
  return new Promise((resolve,reject)=>{
    wx.request({
      url: api.data.requestUrl + api.data.personalDom,
      header: {
        'content-type': 'application/json;charset=UTF-8'
      },
      method: 'GET',
      data: params,
      success: function (res) {
        resolve(res);
        util.show_success_toast(res)
      },
      fail: function () {
        reject();
        util.show_fail_toast()
      },
    })
  })
}
// 修改个人资料
function edit_personal_dom(params,token) {
  return new Promise((resolve,reject)=>{
    wx.request({
      url: api.data.requestUrl + api.data.editPersonalDom,
      header: {
        'content-type': 'application/json;charset=UTF-8',
        'x-access-token': token
      },
      method: 'POST',
      data: params,
      success: function (res) {
        resolve(res);
        util.show_success_toast(res)
      },
      fail: function () {
        reject();
        util.show_fail_toast()
      },
    })
  })
}
// 宝宝列表
function get_baby_list(params) {
  return new Promise((resolve,reject)=>{
    wx.request({
      url: api.data.requestUrl + api.data.babyList,
      header: {
        'content-type': 'application/json;charset=UTF-8'
      },
      method: 'GET',
      data: params,
      success: function (res) {
        resolve(res);
        util.show_success_toast(res)
      },
      fail: function () {
        reject();
        util.show_fail_toast()
      },
    })
  })
}
// 宝宝详情
function get_baby_detail(params) {
  return new Promise((resolve,reject)=>{
    wx.request({
      url: api.data.requestUrl + api.data.babyDetail,
      header: {
        'content-type': 'application/json;charset=UTF-8'
      },
      method: 'GET',
      data: params,
      success: function (res) {
        resolve(res);
        util.show_success_toast(res)
      },
      fail: function () {
        reject();
        util.show_fail_toast()
      },
    })
  })
}
// 新增宝宝
function add_baby(params,token) {
  return new Promise((resolve,reject)=>{
    wx.request({
      url: api.data.requestUrl + api.data.addBaby,
      header: {
        'content-type': 'application/json;charset=UTF-8',
        'x-access-token': token
      },
      method: 'POST',
      data: params,
      success: function (res) {
        resolve(res);
        util.show_success_toast(res)
      },
      fail: function () {
        reject();
        util.show_fail_toast()
      },
    })
  })
}
// 修改宝宝
function edit_baby(params) {
  return new Promise((resolve,reject)=>{
    wx.request({
      url: api.data.requestUrl + api.data.editBaby,
      header: {
        'content-type': 'application/json;charset=UTF-8'
      },
      method: 'POST',
      data: params,
      success: function (res) {
        resolve(res);
        util.show_success_toast(res)
      },
      fail: function () {
        reject();
        util.show_fail_toast()
      },
    })
  })
}
// 删除宝宝判断
function judeg_del_baby(params) {
  return new Promise((resolve,reject)=>{
    wx.request({
      url: api.data.requestUrl + api.data.judegDelBaby,
      header: {
        'content-type': 'application/json;charset=UTF-8'
      },
      method: 'GET',
      data: params,
      success: function (res) {
        resolve(res);
        util.show_success_toast(res)
      },
      fail: function () {
        reject();
        util.show_fail_toast()
      },
    })
  })
}
// 删除宝宝
function del_baby(params) {
  return new Promise((resolve,reject)=>{
    wx.request({
      url: api.data.requestUrl + api.data.delBaby,
      header: {
        'content-type': 'application/json;charset=UTF-8'
      },
      method: 'GET',
      data: params,
      success: function (res) {
        resolve(res);
        util.show_success_toast(res)
      },
      fail: function () {
        reject();
        util.show_fail_toast()
      },
    })
  })
}
// 获取认证分校列表
function get_org_audi_list(params,token) {
  return new Promise((resolve,reject)=>{
    wx.request({
      url: api.data.requestUrl + api.data.getOrgAuditList,
      header: {
        'content-type': 'application/json;charset=UTF-8',
        'x-access-token': token
      },
      method: 'GET',
      data: params,
      success: function (res) {
        resolve(res);
        util.show_success_toast(res)
      },
      fail: function () {
        reject();
        util.show_fail_toast()
      },
    })
  })
}
// 根据机构编号查询机构账户余额
function get_mech_cach(params) {
  return new Promise((resolve,reject)=>{
    wx.request({
      url: api.data.requestUrl + api.data.getMechCach,
      header: {
        'content-type': 'application/json;charset=UTF-8'
      },
      method: 'GET',
      data: params,
      success: function (res) {
        resolve(res);
        util.show_success_toast(res)
      },
      fail: function () {
        reject();
        util.show_fail_toast()
      },
    })
  })
}
// 根据机构编号和提现账户类型查询
function get_business_type(params,token) {
  return new Promise((resolve,reject)=>{
    wx.request({
      url: api.data.requestUrl + api.data.getBusinessType,
      header: {
        'content-type': 'application/json;charset=UTF-8',
        'x-access-token': token
      },
      method: 'GET',
      data: params,
      success: function (res) {
        resolve(res);
        // util.show_success_toast(res)
      },
      fail: function () {
        reject();
        // util.show_fail_toast()
      },
    })
  })
}
// 获取账单列表
function get_bill_list(params,token) {
  return new Promise((resolve,reject)=>{
    wx.request({
      url: api.data.requestUrl + api.data.getBillList,
      header: {
        'content-type': 'application/json;charset=UTF-8',
        'x-access-token': token
      },
      method: 'GET',
      data: params,
      success: function (res) {
        resolve(res);
        util.show_success_toast(res)
      },
      fail: function () {
        reject();
        util.show_fail_toast()
      },
    })
  })
}
// 获取可提现订单
function get_cash_order_list(params) {
  return new Promise((resolve,reject)=>{
    wx.request({
      url: api.data.requestUrl + api.data.cashOrderList,
      header: {
        'content-type': 'application/json;charset=UTF-8'
      },
      method: 'GET',
      data: params,
      success: function (res) {
        resolve(res);
        util.show_success_toast(res)
      },
      fail: function () {
        reject();
        util.show_fail_toast()
      },
    })
  })
}
// 用户提现
function user_cash(params,token,x_token) {
  return new Promise((resolve,reject)=>{
    wx.request({
      url: api.data.requestUrl + api.data.userCash,
      header: {
        'content-type': 'application/json;charset=UTF-8',
        'x-access-token': token,
        'x-idempotent-token': x_token
      },
      method: 'POST',
      data: params,
      success: function (res) {
        resolve(res);
        util.show_success_toast(res)
      },
      fail: function () {
        reject();
        util.show_fail_toast()
      },
    })
  })
}
// 全部提现订单号
function get_mech_all_order(params) {
  return new Promise((resolve,reject)=>{
    wx.request({
      url: api.data.requestUrl + api.data.getMechAllOrder,
      header: {
        'content-type': 'application/json;charset=UTF-8'
      },
      method: 'GET',
      data: params,
      success: function (res) {
        resolve(res);
        util.show_success_toast(res)
      },
      fail: function () {
        reject();
        util.show_fail_toast()
      },
    })
  })
}
// 问题列表
function get_problem_list(params) {
  return new Promise((resolve,reject)=>{
    wx.request({
      url: api.data.requestUrl + api.data.problemList,
      header: {
        'content-type': 'application/json;charset=UTF-8'
      },
      method: 'GET',
      data: params,
      success: function (res) {
        resolve(res);
        util.show_success_toast(res)
      },
      fail: function () {
        reject();
        util.show_fail_toast()
      },
    })
  })
}
// 用户反馈
function set_feed_back(params) {
  return new Promise((resolve,reject)=>{
    wx.request({
      url: api.data.requestUrl + api.data.userFeedBack,
      header: {
        'content-type': 'application/json;charset=UTF-8'
      },
      method: 'POST',
      data: params,
      success: function (res) {
        resolve(res);
        util.show_success_toast(res)
      },
      fail: function () {
        reject();
        util.show_fail_toast()
      },
    })
  })
}
// 获取版本信息
function get_version_info(params) {
  return new Promise((resolve,reject)=>{
    wx.request({
      url: api.data.requestUrl + api.data.getVersionInfo,
      header: {
        'content-type': 'application/json;charset=UTF-8'
      },
      method: 'GET',
      data: params,
      success: function (res) {
        resolve(res);
        util.show_success_toast(res)
      },
      fail: function () {
        reject();
        util.show_fail_toast()
      },
    })
  })
}
// 更换手机号
function change_phone(params) {
  return new Promise((resolve,reject)=>{
    wx.request({
      url: api.data.requestUrl + api.data.changePhone,
      header: {
        'content-type': 'application/json;charset=UTF-8'
      },
      method: 'POST',
      data: params,
      success: function (res) {
        resolve(res);
        // util.show_success_toast(res)
      },
      fail: function () {
        reject();
        util.show_fail_toast()
      },
    })
  })
}
// 验证码设置密码
function set_password_code(params) {
  return new Promise((resolve,reject)=>{
    wx.request({
      url: api.data.requestUrl + api.data.setPasswordCode,
      header: {
        'content-type': 'application/json;charset=UTF-8'
      },
      method: 'POST',
      data: params,
      success: function (res) {
        resolve(res);
        // util.show_success_toast(res)
      },
      fail: function () {
        reject();
        util.show_fail_toast()
      },
    })
  })
}
// 旧密码设置密码
function set_password_old(params) {
  return new Promise((resolve,reject)=>{
    wx.request({
      url: api.data.requestUrl + api.data.setPasswordOld,
      header: {
        'content-type': 'application/json;charset=UTF-8'
      },
      method: 'POST',
      data: params,
      success: function (res) {
        resolve(res);
        // util.show_success_toast(res)
      },
      fail: function () {
        reject();
        util.show_fail_toast()
      },
    })
  })
}
// 新增团员
function newTeamCount(token) {
  return new Promise((resolve,reject)=>{
    wx.request({
      url: api.data.requestUrl + api.data.newTeamCount,
      header: {
        'content-type': 'application/json;charset=UTF-8',
        'x-access-token': token,
      },
      method: 'GET',
      success: function (res) {
        resolve(res);
        util.show_success_toast(res)
      },
      fail: function () {
        reject();
        util.show_fail_toast()
      },
    })
  })
}
// 团队收益
function teamMoney(token) {
  return new Promise((resolve,reject)=>{
    wx.request({
      url: api.data.requestUrl + api.data.teamMoney,
      header: {
        'content-type': 'application/json;charset=UTF-8',
        'x-access-token': token,
      },
      method: 'GET',
      success: function (res) {
        resolve(res);
        util.show_success_toast(res)
      },
      fail: function () {
        reject();
        util.show_fail_toast()
      },
    })
  })
}
// 获取团队成员
function get_team(params,token) {
  return new Promise((resolve,reject)=>{
    wx.request({
      url: api.data.requestUrl + api.data.getTeam,
      header: {
        'content-type': 'application/json;charset=UTF-8',
        'x-access-token': token,
      },
      method: 'GET',
      data: params,
      success: function (res) {
        resolve(res);
        util.show_success_toast(res)
      },
      fail: function () {
        reject();
        util.show_fail_toast()
      },
    })
  })
}
// 获取收益账单
function get_commission_order(params,token) {
  return new Promise((resolve,reject)=>{
    wx.request({
      url: api.data.requestUrl + api.data.getCommissionOrder,
      header: {
        'content-type': 'application/json;charset=UTF-8',
        'x-access-token': token,
      },
      method: 'GET',
      data: params,
      success: function (res) {
        resolve(res);
        util.show_success_toast(res)
      },
      fail: function () {
        reject();
        util.show_fail_toast()
      },
    })
  })
}
// 获取推广码
function userQRcode(params,token) {
  return new Promise((resolve,reject)=>{
    wx.request({
      url: api.data.requestUrl + api.data.userQRcode,
      header: {
        'content-type': 'application/json;charset=UTF-8',
        'x-access-token': token,
      },
      method: 'GET',
      data: params,
      success: function (res) {
        resolve(res);
        util.show_success_toast(res)
      },
      fail: function () {
        reject();
        util.show_fail_toast()
      },
    })
  })
}
// 获取钱包可提现金额
function getBalance(token) {
  return new Promise((resolve,reject)=>{
    wx.request({
      url: api.data.requestUrl + api.data.getBalance,
      header: {
        'content-type': 'application/json;charset=UTF-8',
        'x-access-token': token,
      },
      method: 'GET',
      success: function (res) {
        resolve(res);
        util.show_success_toast(res)
      },
      fail: function () {
        reject();
        util.show_fail_toast()
      },
    })
  })
}
// 钱包提现
function walletCash(params,token) {
  return new Promise((resolve,reject)=>{
    wx.request({
      url: api.data.requestUrl + api.data.userWalletCash,
      header: {
        'content-type': 'application/json;charset=UTF-8',
        'x-access-token': token,
      },
      method: 'POST',
      data: params,
      success: function (res) {
        resolve(res);
        util.show_success_toast(res)
      },
      fail: function () {
        reject();
        util.show_fail_toast()
      },
    })
  })
}
// 钱包提现记录
function walletCashRecords(params,token) {
  return new Promise((resolve,reject)=>{
    wx.request({
      url: api.data.requestUrl + api.data.walletCashRecords,
      header: {
        'content-type': 'application/json;charset=UTF-8',
        'x-access-token': token,
      },
      method: 'GET',
      data: params,
      success: function (res) {
        resolve(res);
        util.show_success_toast(res)
      },
      fail: function () {
        reject();
        util.show_fail_toast()
      },
    })
  })
}

module.exports={
  get_org_list,
  user_register_mech,
  get_mech_type,
  get_order_count,
  get_order_list,
  get_meal_detail,
  get_less_list,
  cancel_order,
  confirm_table,
  cancel_table,
  refund_order,
  get_course_type,
  call_all_count,
  get_cash_order_list,
  get_call_cour_list,
  get_call_mech_list,
  get_call_base_list,
  get_call_teac_list,
  get_pref_nav,
  get_my_pref_list,
  get_receive_count,
  get_every_pref_list,
  get_unRead_news,
  get_unRead_cateNews,
  get_news_list,
  read_news,
  get_newsDetail_list,
  get_personal_dom,
  edit_personal_dom,
  get_baby_list,
  add_baby,
  get_baby_detail,
  edit_baby,
  judeg_del_baby,
  del_baby,
  get_org_audi_list,
  get_mech_cach,
  get_business_type,
  get_bill_list,
  user_cash,
  get_mech_all_order,
  get_problem_list,
  set_feed_back,
  get_version_info,
  change_phone,
  set_password_code,
  set_password_old,
  newTeamCount,
  teamMoney,
  get_team,
  get_commission_order,
  userQRcode,
  getBalance,
  walletCash,
  walletCashRecords
}